package com.game.src.main;

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;

public class Message {
	
	private String message;
	private int ticks;
	private int remainingTicks;
	private int size = 50;
	private boolean increase = false;
	
	
	public Message(String message, int ticks) {
		this.message = message;
		this.ticks = ticks;
		this.remainingTicks = ticks;
	}
	
	
	
	public void render(Graphics g){
		g.setColor(Color.GREEN);
		g.setFont(new Font("Impact", Font.PLAIN, size));
		g.drawString(message,10 , 460);
	}
	
	
	public void tick(){
		remainingTicks--;
		
		if(increase){
			size+=2;
			if(size > 60){
				increase = false;
			}
		} else{
			size-=2;
			if(size < 20){
				increase = true;
			}
		}
	}



	/**
	 * @return the message
	 */
	public String getMessage() {
		return message;
	}



	/**
	 * @return the ticks
	 */
	public int getRemainingTicks() {
		return remainingTicks;
	}
}
